package andytest;

import static org.junit.Assert.*;

import org.junit.*;

import uk.ac.glasgow.demosocs.impl.election.ElectionImpl;
import uk.ac.glasgow.demosocs.impl.election.ElectionStoreImpl;
import uk.ac.glasgow.demosocs.users.UserStoreImpl;

public class ObjectStorageTest {
	ElectionStoreImpl mElections;
	
	@Before
	public void setUp() throws Exception {
		mElections  = new ElectionStoreImpl("elections_test.dat");
	}
	@After
	public void tearDown() throws Exception {
	}
	
	@Test
	public void testElectionStorageTest(){
		assertNotNull(mElections);
		ElectionImpl ele = new ElectionImpl("Name1", "Type1");
		ele.setElectionID("1");		
		mElections.addElectionImpl(ele);
		
		ElectionImpl ele2;
		ele2 = new ElectionImpl("Name2", "Type2");
		ele2.setElectionID("2");
		mElections.addElectionImpl(ele2);

		ElectionImpl ele3 = new ElectionImpl("Name3","Type3");
		mElections.addElectionImpl(ele3);
		
		for(ElectionImpl election : mElections.getTheElections()){
			System.out.println(election.getEID());
		}
	}
}
